/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gace.basededatos;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * 
 *
 * @author german
 */
public class Conexion {
    public static Connection getConexion() throws SQLException {
        try {
            Class.forName("com.mysql.jdbc.Driver");
            System.out.println("Conectando a la base de datos");
            return DriverManager.getConnection("jdbc:mysql://localhost:3306/mydb", "root", "");
        } catch (ClassNotFoundException ex) {
            throw new SQLException(ex.getMessage());
        }

    }
}
